<?php
class smarty_ext_reiting {

	function smarty_ext_reiting() {
		global $setupdata, $mysqlclass, $reitingclass;
		$this->setupdata=$setupdata;
		$this->mysqlclass=$mysqlclass;
		$this->reitingclass=$reitingclass;
	}

	function get_reitings(){
		return $this->reitingclass->get_reiting();
	}
	
	function get_reitings_by_parent_id_and_type($params){
		if (isset($params['id']) && isset($params['type'])) return $this->reitingclass->get_reitings_by_parent_id_and_type($params['id'], $params['type']);
		else return array();
	}
		
	function get_reitings_by_parent_id_type_and_name($params){
		if (isset($params['id']) && isset($params['type']) && isset($params['name'])) return $this->reitingclass->get_reitings_by_parent_id_type_and_name($params['id'], $params['type'], $params['name']);
		else return array();
	}

	function get_sorted_reitings_type_and_name($params){
		if (isset($params['type']) && isset($params['name']) && isset($params['sort']) && isset($params['sortby'])) return $this->reitingclass->get_sorted_reitings_type_and_name($params['type'], $params['name'], $params['sortby'], $params['sort']);
		else return array();
	}

	function is_can_reiting($params){
		if (isset($params['id']) && isset($params['type']) && isset($params['name'])){
			return $this->reitingclass->is_can_reiting($params['id'], $params['type'], $params['name'], 1);
		} else return 0;
	}
	
	// NEW 2007.04.27
	
	function get_new_reitings(){
		return $this->reitingclass->get_new_reitings();
	}
	
	function get_one_reiting_data($params){
		if (isset($params['id'])){
			return $this->reitingclass->get_one_reiting_data($params['id']);
		}
	}
	
	function get_checking(){
		return $this->reitingclass->get_checking();
	}
	
	function start_raiting_sessios($params){
		if (isset($params['id'])){
			return $this->reitingclass->start_raiting_sessios($params['id']);
		}
	}
	
	function get_data($params){
		if (isset($params['id'])){
			return $this->reitingclass->get_data($params['id']);
		}
	}
	
}
?>